﻿using System;
using HiTeachers.Services;

namespace HiTeachers.Web
{
    public partial class ActivationAccount : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var actId = new Guid(Request["actid"]);
            var teacher = TeacherServices.GetById(actId);

            if (teacher == null)
            {
                divError.Visible = true;
                divSuccess.Visible = false;
                return;
            }

            teacher.IsVerified = true;
            TeacherServices.SaveOrUpdate(teacher);
            divError.Visible = false;
            divSuccess.Visible = true;
        }
    }
}
